package com.jkc.xh.adapters.viewholder;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.jkc.xh.R;
import com.jkc.xh.models.MagicBeanModel;
import com.jkc.xh.utils.Tool;

import org.androidannotations.annotations.EViewGroup;
import org.androidannotations.annotations.ViewById;

/**
 * Created by wangjie28 on 2015/11/13.
 */
@EViewGroup(R.layout.item_magic_bean)
public class MagicBeanItemView extends RelativeLayout {


    @ViewById
    TextView pre_money;
    @ViewById
    TextView pay_money;
    @ViewById
    TextView bal_money;
    @ViewById
    TextView remark;
    @ViewById
    TextView stock_code;
    @ViewById
    TextView stock_name;
    @ViewById
    ImageView itemTypeIcon;

    @ViewById(R.id.create_time)
    TextView create_time;

    public MagicBeanItemView(Context context) {
        super(context);
    }

    public MagicBeanItemView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }


    public void bind(MagicBeanModel model) {
        pre_money.setText(model.pre_money);
        pay_money.setText(model.pay_money);
        bal_money.setText(model.bal_money);
        remark.setText(model.remark);
        stock_code.setText(model.stock_code);
        stock_name.setText(model.stock_name);
        create_time.setText(Tool.formatSecondSimpleFullDate(model.create_time));
    }


}
